package com.peak.distribution.manager.agent.impl;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.peak.distribution.entity.agent.DisAgent;
import com.peak.distribution.manager.agent.DisAgentManager;
import com.peak.spring.boot.builder.repository.FilterParamBuilder;
import com.peak.spring.boot.core.manager.BaseManagerImpl;

@Component
@Transactional(readOnly = true)
public class DisAgentManagerImpl extends BaseManagerImpl<DisAgent> implements DisAgentManager {

	@Override
	public DisAgent getByUserId(Integer userId) {
		return super.findFirstOne(FilterParamBuilder.create().eq("user.id", userId).build());
	}

	@Override
	public DisAgent getByMobileNo(String mobileNo) {
		return super.findOne(FilterParamBuilder.create().eq("mobileNo", mobileNo).build());
	}

}
